package com.dianping.cat.alarm;

import java.util.Date;
import java.util.List;
import org.unidal.dal.jdbc.AbstractDao;
import org.unidal.dal.jdbc.DalException;
import org.unidal.dal.jdbc.Readset;
import org.unidal.dal.jdbc.Updateset;

public class AlertDao extends AbstractDao {
/*  11 */   public Alert createLocal() { return new Alert(); }





/*  17 */   public int deleteByPK(Alert proto) throws DalException { return getQueryEngine().deleteSingle(AlertEntity.DELETE_BY_PK, proto); }




  public List<Alert> queryAlertsByTimeDomain(Date startTime, Date endTime, String domain, Readset<Alert> readset) throws DalException {
/*  23 */     Alert proto = new Alert();

    proto.setStartTime(startTime);
/*  26 */     proto.setEndTime(endTime);
/*  27 */     proto.setDomain(domain);

    return getQueryEngine().queryMultiple(AlertEntity.QUERY_ALERTS_BY_TIME_DOMAIN, proto, readset);
  }






  public List<Alert> queryAlertsByTimeDomainCategories(Date startTime, Date endTime, String domain, String[] categories, Readset<Alert> readset) throws DalException {
/*  38 */     Alert proto = new Alert();

/*  40 */     proto.setStartTime(startTime);
/*  41 */     proto.setEndTime(endTime);
/*  42 */     proto.setDomain(domain);
/*  43 */     proto.setCategories(categories);

/*  45 */     return getQueryEngine().queryMultiple(AlertEntity.QUERY_ALERTS_BY_TIME_DOMAIN_CATEGORIES, proto, readset);
  }






  public List<Alert> queryAlertsByTimeCategoryDomain(Date startTime, Date endTime, String category, String domain, Readset<Alert> readset) throws DalException {
/*  54 */     Alert proto = new Alert();

/*  56 */     proto.setStartTime(startTime);
/*  57 */     proto.setEndTime(endTime);
/*  58 */     proto.setCategory(category);
/*  59 */     proto.setDomain(domain);

/*  61 */     return getQueryEngine().queryMultiple(AlertEntity.QUERY_ALERTS_BY_TIME_CATEGORY_DOMAIN, proto, readset);
  }






  public List<Alert> queryAlertsByTimeCategory(Date startTime, Date endTime, String category, Readset<Alert> readset) throws DalException {
/*  70 */     Alert proto = new Alert();

/*  72 */     proto.setStartTime(startTime);
/*  73 */     proto.setEndTime(endTime);
/*  74 */     proto.setCategory(category);

/*  76 */     return getQueryEngine().queryMultiple(AlertEntity.QUERY_ALERTS_BY_TIME_CATEGORY, proto, readset);
  }






  public Alert findByPK(int keyId, Readset<Alert> readset) throws DalException {
/*  85 */     Alert proto = new Alert();

/*  87 */     proto.setKeyId(keyId);

/*  89 */     return (Alert)getQueryEngine().querySingle(AlertEntity.FIND_BY_PK, proto, readset);
  }








/*  99 */   protected Class<?>[] getEntityClasses() { return new Class[] { AlertEntity.class }; }



/* 103 */   public int insert(Alert proto) throws DalException { return getQueryEngine().insertSingle(AlertEntity.INSERT, proto); }





/* 109 */   public int updateByPK(Alert proto, Updateset<Alert> updateset) throws DalException { return getQueryEngine().updateSingle(AlertEntity.UPDATE_BY_PK, proto, updateset); }
}


/* Location:              /Users/hanfei/Documents/apache-tomcat-9.0.24/webapps/cat/WEB-INF/lib/cat-alarm-3.0.0.jar!/com/dianping/cat/alarm/AlertDao.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       1.0.7
 */